/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import Model.Categorie;
import Model.Client;
import Model.LigneReservation;
import Model.TestData;
import java.util.Date;

/**
 *
 * @author fokasu
 */
public class ReservationController extends AbstractController{
    
    public static final String NUM_CONFIRMATION_PROPERTY = "NumConfirmation";
    
    public static final String CLIENT_NOM_PROPERTY = "NomClient";
    
    public static final String CLIENT_NUM_PROPERTY = "NumClient";
    
    public static final String LIGNE_RESERVATION_PROPERTY = "LigneReservation";
    
    public static final String CLIENT_PROPERTY = "Client";
    
    public static final String NOT_ENOUGH_PLACE_EVENT = "Not enough place in Hotel";
    
    public static final String RESERVATION_MODEL = "Reservation";

    public void updateNumConfirmation() {
        updateProperty(NUM_CONFIRMATION_PROPERTY);                                 
    }
    
    public void changeNomClient(String newNomClient) {
        setModelProperty(CLIENT_NOM_PROPERTY, newNomClient);                                 
    }
    
    public void changeNumClient(String newNumClient) {
        setModelProperty(CLIENT_NUM_PROPERTY, newNumClient);                                 
    }
    
    public void changeClient(Client newClient) {
        setModelProperty(CLIENT_PROPERTY, newClient);                                 
    }
    
    public void updateLigneReservation(){
        updateProperty(LIGNE_RESERVATION_PROPERTY);
    }

    public void addLigneReservation(String categorie, int qte, Date dteDebut, Date dteFin) {
        addLineToModelProperty(LIGNE_RESERVATION_PROPERTY, new LigneReservation(TestData.getCategorie(categorie), qte, dteDebut, dteFin));   
    }
    
    public void addReservation() {
        updateProperty(RESERVATION_MODEL);   
    }
    
    public void deleteReservation(){
        deleteProperty(CLIENT_PROPERTY);
    }
    
}
